﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp2
{
    internal class Program
    {
        static bool IsPrime(int num)
        {
            if (num <= 1) return false;
            if (num == 2) return true;
            if (num % 2 == 0) return false;

            for (int i = 3; i <= Math.Sqrt(num); i += 2)
            {
                if (num % i == 0) return false;
            }
            return true;
        }
        static void Main(string[] args)
        {
            int lower = Convert.ToInt32(Console.ReadLine());
            int upper = Convert.ToInt32(Console.ReadLine());
            int count = 0;
            for (int i = lower; i <= upper; i++)
            {
                if (IsPrime(i))
                {
                    Console.Write($"{i,-6}");
                    count++;

                    if (count % 10 == 0)
                    {
                        Console.WriteLine();
                    }
                }
            }
            if (count % 10 != 0)
            {
                Console.WriteLine();
            }
        }
    }
}
